//生成订单单号
function generateOrderCode() {
    let orderCode='';
    for (let i = 0; i < 6; i++) //6位随机数
    {
        orderCode += Math.floor(Math.random() * 10);
    }
	// 兼容本地与云端时区
	const time = Date.now() + 60 * 1000 * (480 + new Date().getTimezoneOffset());

    orderCode = 'hm' + time + orderCode;
    return orderCode;
}

module.exports = {
	generateOrderCode,
}
